<?php
namespace app\admin\controller;
use think\Controller;
use think\Request;
use think\Db;
use app\service\apiService;
class Base extends Controller{
    public function getuser(){
		$api = new apiService();
		//获取当前车辆支付宝ID
		$code = request()->get('auth_code');
		$oauthtoken = $api->oauthToken($code);
		if(property_exists($oauthtoken,'sub_msg')){
			return json(['info' => $oauthtoken->sub_msg]);
		}
		session('user_id',$oauthtoken->user_id);
        $url=session("url");
        $this->redirect($url);
        die;	
	}	
}